package fourmiefight.abstractionlib2d;

import org.dyn4j.collision.AxisAlignedBounds;
import org.dyn4j.dynamics.Body;
import org.dyn4j.geometry.Rectangle;

public class MyBounds extends AxisAlignedBounds
{
	public RectangleBound b1;
	public RectangleBound b2;
	public RectangleBound b3;
	public RectangleBound b4;
	
	private static final double l = 2;
	private static final double ty = 7.50;
	private static final double tx = 7.50;
	
	public MyBounds(double width, double height) 
	{
		super(width, height);
		b1 = new RectangleBound(width, l, 0, ty);
		b2 = new RectangleBound(width, l, 0, -ty);
		b3 = new RectangleBound(l, height, tx, 0);
		b4 = new RectangleBound(l, height, -tx, 0);
	}
	
	private class RectangleBound extends Body
	{
		public RectangleBound(double width, double height, double tX, double tY) 
		{
			super();
			RectSpe r = new RectSpe(width, height, tX, tY);
			this.addFixture(r);
			this.setMass();
		}
	}
	
	private class RectSpe extends Rectangle
	{
		public RectSpe(double width, double height, double trX, double trY) 
		{
			super(width, height);
			this.translate(trX, trY);
		}
	}
}
